package common;
import common.AppConst;

import java.util.Properties;

public class AppConst {
	//区分国际版
	public static Integer APP_FOR_LOCAL;
	//员工默认头像
	public static String EMPLOYEE_PHOTO_DEFAULT;
	//员工上传头像路径
	public static String EMPLOYEE_PHOTO_PATH;
	public static  String SMS_SEND_CAPTCHA;//短信－发送验证码内容
	//分页参数
	public static int DEFAULT_PAGE_NUM = 1;
	public static int DEFAULT_PAGE_SIZE = 10;
	public static int MOBILE_PAGE_SIZE = 15;
	//推送消息表 -- 临时字段
	public static final String STATUS_CODE_KEY = "code";//"statusCode";
	public static final int STATUC_SUCCESS = 200;//成功代码
	public static final String STATUS_CODE_MSG = "code";//"statusCode";
	public static final String STATUC_SUCCESS_MSG = "OK";//成功信息
	public static String CHOOSE_SYSTEM_LANGUAGE; //选择语言版本如：default：中文/En：英文
	public static String APP_URL; //项目部署URL，例如：www.youtuer.com
	
	public static String MQ_URL; //mq http
	public static String  CONTEXT_PATH; //path
	public static final int MOBILE_ENCRYPT_CODE = 325;
	public static String GRANT_TYPE = "authorization_code";
	//返回报文失败状态码字符串
	public static final String HTTP_STATUS_CODE_FAIL = "300";
	//返回报文成功状态码字符串
	public static final String HTTP_STATUS_CODE_SUCCESS = "200";;
	//信鸽用户名前缀
	public static String XINGE_ID_PREFIX;
	//通用参数
	public static final int DELETE_YES = 1;//已删除
	public static final int DELETE_NO = 0;//未删除
	public static final int USER_AGE_DEFAULT = 25;
	public static final String USER_GENDAR_MALE = "M";
	public static final String USER_GENDAR_DEFAULT = USER_GENDAR_MALE;
	//移动端返回参数
	public static final String MOBILE_KEY_CODE = "code";
	public static final String MOBILE_KEY_MSG = "msg";
	public static final String MOBILE_KEY_MSG_CODE = "msgCode";
	public static final int MOBILE_CODE_SUCCESS = 200;
	public static final int MOBILE_CODE_FAIL = 300;
	public static final int MOBILE_CODE_EXITS = 301;
	public static final String MOBILE_KEY_PARAM = "mobileParam";
	public static final String MOBILE_KEY_USER_ID = "clientId";
	public static final String MOBILE_KEY_TOKEN = "token";
	public static final String MOBILE_KEY_LANGUAGE = "sysLanguage";
	public static final String MOBILE_KEY_LANGUAGE_CH = "CH";
	public static final String MOBILE_KEY_LANGUAGE_EN = "EN";
	public static final String MOBILE_KEY_OS = "os";
	public static final String MOBILE_KEY_APP_VERSION = "appVersion";
	public static final String APP_SYSTEM_OPERATION_ANDROID = "Android";
	//账户类型
	public static final String ACCOUNT_TYPE_PHONE = "PHONE";
	public static final String ACCOUNT_TYPE_EMAIL = "EMAIL";
	public static final String ACCOUNT_TYPE_QQ = "QQ";
	public static final String ACCOUNT_TYPE_WEIXIN = "WECHAT";
	public static final String ACCOUNT_TYPE_WEIBO = "SINAWEIBO";
	//每页面记录数
	public static final int PAGE_SIZE = 20;
	public static final int PAGE_SIZE_TEN = 10;
	public static final int PAGE_SIZE_FIVE = 5;
	//默认页数
	public static final int DEFAULT_PAGE_NUMBER = 1;
	public static final int MYSQL_START_INDEX = 0;
	public static final int STATUS_YES = 1;
	public static final int STATUS_NO = 0;
	//默认推送人
	public static final String MESSAGE_CREATOR_SYS = "系统";
	public static int LIMIT_ONE_THOUSAND = 1000;
	public static String UNVALID_NICK_NAME_LIST = ""; //非法昵称列表
	//官方运营号
	public static int PUBLIC_ACCOUNT_ID;
	public static String PUBLIC_ACCOUNT;
	//网球等级评定系数
	//微信参数
	public static String APPID ;
	public static String SECRET ;
	public static String PARTNER ;
	public static String PARTNERKEY ;
	//微信退款使用的SSL文件路径
	public static String SSLFILEPATH;
	//MD5加密字符
	public static String Md5Str="Youtuer2017";
	//硬件注册名称过滤配置
	public static String FILTERNAME;
	/**
	 * 微信支付交易类型
	 */
	public static String trade_type = "JSAPI";
	
	public static String signType = "MD5";
	
	public static void initFromProperties(Properties properties){
		APP_URL = properties.getProperty("APP_URL");
		MQ_URL = properties.getProperty("MQ_URL");
		CONTEXT_PATH =  properties.getProperty("CONTEXT_PATH");
		EMPLOYEE_PHOTO_DEFAULT = properties.getProperty("EMPLOYEE_PHOTO_DEFAULT");
		EMPLOYEE_PHOTO_PATH = properties.getProperty("EMPLOYEE_PHOTO_PATH");
		PUBLIC_ACCOUNT = properties.getProperty("PUBLIC_ACCOUNT");
		CHOOSE_SYSTEM_LANGUAGE = properties.getProperty("CHOOSE_SYSTEM_LANGUAGE");//选择语言版本如：default：中文/En：英文 ;		
		SMS_SEND_CAPTCHA = properties.getProperty("SMS_SEND_CAPTCHA");//短信－发送验证码
		APPID = properties.getProperty("APPID");//微信公众平台ID
		SECRET= properties.getProperty("SECRET");//微信公众平台SECRET
		PARTNER = properties.getProperty("PARTNER");//微信公众平台商户ID
		PARTNERKEY= properties.getProperty("PARTNERKEY");//微信公众平台商户key
		SSLFILEPATH = properties.getProperty("SSLFILEPATH");//微信SSL路径
		FILTERNAME = properties.getProperty("FILTERNAME");//硬件注册名称过滤配置
	}
	
}